Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix connection delete and change table actions UX #45

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Conversation

Matozinho
Copy link
Collaborator

@Matozinho Matozinho commented Oct 29, 2024

This pull request closes #44 and includes significant refactoring and improvements to the connections management and query execution functionalities. The most important changes involve migrating state management to a custom hook, enhancing user feedback with loading states, and refactoring the connection table component to improve code readability and maintainability.

Refactoring and State Management:

User Feedback Enhancements:

Component and Import Improvements:

Miscellaneous Changes:

These changes collectively improve the codebase by enhancing user experience, improving state management, and making the components more modular and maintainable.

… types

feat(connection-table.tsx): add Skeleton loading component for better user experience
feat(connection-table.tsx): add toast notifications for successful and error actions
feat(connection-table.tsx): refactor handleSave, handleDelete, handleRefresh functions
feat(connection-table.tsx): update setCurrentConnection usage
feat(modal.tsx): update import statement for Loader2 component
feat(modal.tsx): update button text to show loader while saving
feat(row-actions.tsx): create RowActions component for connection actions
feat(table-item.tsx): update import statement for Connection type

feat(cql-editor.tsx): add loading state for query execution to provide visual feedback to users
feat(cql-editor.tsx): implement async execution of queries to handle asynchronous operations
feat(cql-editor.tsx): add Skeleton component to display loading state while fetching data
feat(layout.tsx): add loadingKeyspaces state to indicate when keyspaces are being fetched
feat(layout.tsx): update queryKeyspace and fetchInitialConnections to return promises
feat(use-connections.ts): create useConnectionsStore to manage connection-related state and actions
feat(internal-db/connections.ts): convert deleteConnectionById to an async function
feat(menu-list.ts): use startTransition to fetch initial connections and query keyspace
feat(utils.ts): add sleep function to pause execution for a specified time

Signed-off-by: matozinho <[email protected]>
@Matozinho Matozinho added enhancement New feature or request hacktoberfest The solution to this issue may acquire hacktoberfest-accepted labels Oct 29, 2024
@Matozinho Matozinho self-assigned this Oct 29, 2024
@Matozinho Matozinho linked an issue Oct 29, 2024 that may be closed by this pull request
3 tasks
Comment on lines +26 to +31
// db.exec(`
// INSERT OR IGNORE INTO connections
// (id, name, status, host, port, username, password, dc, nodes)
// VALUES
// (1, 'ScyllaDB Localhost', 'Offline', 'localhost', '9042', null, null, 'local', 1)
// `);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding that: this query only runs in right after the SQLite file is generated. Usually these credentials are default for LocalHost with ScyllaDB Docker Images, that's why I maintained it there.

It was conflicting with something else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing the strange behavior on deleting that @Daniel-Boll had mentioned earlier because when you delete this from db, it just adds again when the file is re-executed.

We may keep it and find a way to avoid this specific entry from being deleted.

@DanielHe4rt DanielHe4rt merged commit d14b2bb into main Oct 29, 2024
3 checks passed
@DanielHe4rt DanielHe4rt deleted the issue/44 branch October 29, 2024 21:27
@Matozinho Matozinho added hacktoberfest-accepted Hacktoberfest-able PR and removed hacktoberfest The solution to this issue may acquire hacktoberfest-accepted labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest-accepted Hacktoberfest-able PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix connection delete and change table actions UX
4 participants